package com.legsem.jhosync;

/**
 * Provides contextual data that can be shared between the server code and
 * developers custom code.
 * 
 */
public interface Context {

    /**
     * Fetch a parameter that was set at server configuration time.
     * 
     * @param name parameter name
     * @return parameter value
     */
    Object getConfigAttribute(String name);

    /**
     * Fetch a parameter that was set for the duration of a session. Such a
     * parameter is private to a single client.
     * 
     * @param name parameter name
     * @return parameter value
     */
    Object getSessionAttribute(String name);

    /**
     * Set a parameter visible to a client only for the duration of a session.
     * 
     * @param name parameter name
     * @param value parameter value
     */
    void setSessionAttribute(String name, Object value);

}
